package org.zjt.design.pattern;

import lombok.extern.slf4j.Slf4j;

/**
 * @author <a href="juntao.zhang@qq.com">juntao.zhang</a>
 * @Description: 门面模式
 * @Package org.zjt.design.pattern
 * @date 2018/5/8 18:01
 * @see
 */
public class FacadeTest {

    public static void main(String[] args) {
        new PersonFacade(new PersonAction()).run();
    }

}


interface Runnable{

    void run();
}

@Slf4j
class PersonAction implements Runnable{

    @Override
    public void run(){
        log.info("---------run-----------");
    }

}

/**
 * 门面模式
 */
class PersonFacade implements Runnable{

    final PersonAction personAction;


    public PersonFacade(PersonAction personAction) {
        this.personAction = personAction;
    }

    @Override
    public void run() {
        personAction.run();
    }
}